package com.training.collections.listex;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ArrayListEx1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		List arrayList = new ArrayList();

		arrayList.add("Three");
		arrayList.add("Two");
		arrayList.add("Three");
		arrayList.add("Four");
		arrayList.add("One");

		System.out.println("Display ---" + arrayList.get(4));

		arrayList.add(4, "SIX");
		arrayList.set(2, "SEVEN");
		List  subList = arrayList.subList(0,4);
		
		System.out.println("SubList is -- "+subList.size());
		
		System.out.println(" Size is -- " + arrayList.size());

		for (int i = 0; i < arrayList.size(); i++) {
			System.out.println(arrayList.get(i));
		}
	}

}
